<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Sms extends CH_Controller{

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -  
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in 
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see http://codeigniter.com/user_guide/general/urls.html
	 */
	 /**
         * Constructor
         */
	function __construct() { 
		parent::__construct(); 
		$this->init();
		$this->load->model(array('sms_model','setting_model'));
		$this->load->helper('file');
	
    } 
    	

	/**
	 * SMS 일괄발송 폼
	 *
	 * @access	public
	 * @return	result
	 */
	function smsForm(){
		login_admin();
		$this->load->helper('directory');
		$url = $this->uri_church();
		
		$dic = directory_map('./template/sms',1);
		$target = $this->sms_model->select_count_target();
		$content = null;
		if($this->input->post('template')){
			$content = $this->sms_model->get_sms_body();
		}
		
		$data = array(
				'_title' => 'SMS일괄발송',
				'_group' => 'member',
				'_content' => $this->config->item('ch_manager_root').'/'.$url,
				'template_list' => $dic,
				'target' => $target,
				'content' => $content
		);
		
		return $data ;
	}
	
	
}

/* End of file html.php */
/* Location: ./application/controllers/sms.php */